/*
 Copyright 2007 Ole Rogeberg

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 */
package org.lifeyears.model;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.OneToMany;

import org.hibernate.validator.Length;

/**
 * An entity representing a humanitarian organization.
 * 
 * @author Aleksander Blomskøld
 */
@Entity
public class Organization
    extends AbstractEternalEntity
{

    @Column( nullable = false, unique = true )
    @Length( min = 2, max = 50 )
    private String name;

    // a _short_ XHTML-description of the project
    @Column( nullable = false )
    @Lob
    private String shortDescription;

    // an XHTML-description of the project
    @Column( nullable = false )
    @Lob
    private String description;

    // URL to the homepage of this organization
    private String homePage;

    @OneToMany( mappedBy = "organization" )
    private Set<Project> projects;

    public String getName()
    {
        return name;
    }

    public void setName( final String name )
    {
        this.name = name;
    }

    public String getDescription()
    {
        return description;
    }

    public void setDescription( final String description )
    {
        this.description = description;
    }

    public String getHomePage()
    {
        return homePage;
    }

    public void setHomePage( final String homePage )
    {
        this.homePage = homePage;
    }

    public Set<Project> getProjects()
    {
        return projects;
    }

    public void setProjects( final Set<Project> projects )
    {
        this.projects = projects;
    }

    public String getShortDescription()
    {
        return shortDescription;
    }

    public void setShortDescription( final String shortDescription )
    {
        this.shortDescription = shortDescription;
    }
}
